package org.wu.spring.db.integration.compare.application.impl;

import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.wu.spring.db.integration.compare.application.SysUserApplication;
import org.wu.spring.db.integration.compare.domain.model.sys.user.SysUser;
import org.wu.spring.db.integration.compare.application.assembler.SysUserDTOAssembler;
import org.wu.spring.db.integration.compare.application.dto.SysUserDTO;

import org.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;

import jakarta.annotation.Resource;
import org.wu.spring.db.integration.compare.domain.model.sys.user.SysUserRepository;

import java.util.List;


/**
 * describe sys_user
 *
 * @author Jia wei Wu
 * @date 2024/02/28 11:27 上午
 **/
@LazyApplication
public class SysUserApplicationImpl implements SysUserApplication {

    @Resource
    SysUserRepository sysUserRepository;



    /**
     * describe 批量新增
     *
     * @param rowSize    @return {@link Result<List<SysUser>>} 新增后领域对象集合
     * @param columnSize
     * @author Jia wei Wu
     * @date 2024/02/28 11:27 上午
     **/

    @Override
    public Result<List<SysUser>> batchStory(int rowSize, int columnSize) {
        try {
            return sysUserRepository.batchStory(rowSize,columnSize);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }


    /**
     * describe 分页查询多个
     *
     * @param rowSize
     * @param columnSize
     * @return {@link Result<LazyPage<SysUserDTO>>} 分页DTO对象
     * @author Jia wei Wu
     * @date 2024/02/28 11:27 上午
     **/

    @Override
    public Result<LazyPage<SysUserDTO>> findPage(int rowSize, int columnSize) {

        try {
             sysUserRepository.findPage(rowSize, columnSize);
             return ResultFactory.successOf();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }


}